package com.seari.web.controller;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.seari.bean.ReqPlanShiftBean;
import com.seari.pojo.MessageBean;
import com.seari.service.PlanSchedulingService;
import com.seari.web.vo.PlanShiftVO;

@Controller
public class PlanShiftController
{
	@Autowired
	PlanSchedulingService planSchedulingService;
	
	
	@RequestMapping(value = "plan/planShift")
	@ResponseBody
	public MessageBean getPlanShiftInfo(PlanShiftVO planShiftVO) {
		MessageBean mb = new MessageBean();
		ReqPlanShiftBean bean = new ReqPlanShiftBean();
		bean.setReqShiftDate(planShiftVO.getReqShiftDate());
		List<Object> planScheduInfo = null;
		try
		{
			planScheduInfo = planSchedulingService.fetchPlanSchedulingViewData(bean);
			mb.setCode("success");
			mb.setData(planScheduInfo);
		} catch (Exception e)
		{
			mb.setCode("error");
			mb.setMessage("执行异常...");
		}
		return mb;
	}
}
